package com.dddd.blog.api.user.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author dddd
 * @since 2022-02-27
 */
@TableName("ums_user")
@ApiModel(value = "User对象", description = "用户表")
@Data
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("等级id")
    private Long levelId;

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("用户密码")
    private String password;

    @ApiModelProperty("用户密钥（盐）")
    private String salt;

    @ApiModelProperty("头像链接")
    private String icon;

    @ApiModelProperty("昵称")
    private String nickname;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("性别")
    private Integer gender;

    @ApiModelProperty("生日")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    @ApiModelProperty("注册时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;


    @ApiModelProperty("状态，-2=无效，-1=未激活，0=激活正常，2=登录在线")
    private Integer status;

    @ApiModelProperty("成长值")
    private Integer growth;

    @ApiModelProperty("平台唯一码")
    private String uuid;

    @ApiModelProperty("角色id")
    private Long roleId;


    @ApiModelProperty("主页链接")
    private String homeLink;

    @Override
    public String toString() {
        return "User{" +
            "id=" + id +
            ", levelId=" + levelId +
            ", username=" + username +
            ", password=" + password +
            ", slat=" + salt +
            ", icon=" + icon +
            ", nickname=" + nickname +
            ", email=" + email +
            ", gender=" + gender +
            ", birthday=" + birthday +
            ", createTime=" + createTime +
            ", status=" + status +
            ", growth=" + growth +
            ", uuid=" + uuid +
            ", roleId=" + roleId +
            ", homeLink=" +  homeLink +
        "}";
    }
}
